﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using deal_h2ck.Business;
using deal_h2ck.DTO;

namespace deal_h2ck
{
    public partial class DangKyThanhVien : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.UrlReferrer != null)
                    ViewState["RefUrl"] = Request.UrlReferrer.ToString();
            }
        }

        protected void btnDangKy_Click(object sender, EventArgs e)
        {
            CKhachHangDTO dto = new CKhachHangDTO(txtEmal.Text, txtMatKhau.Text);
            dto.HoTen = txtHoTen.Text;
            dto.NgaySinh = txtNgaySinh.Text;
            dto.NgayDangKy = System.DateTime.Now.ToShortDateString();
            dto.DiaChi = txtDiaChi.Text;
            dto.LoaiKH = cbxLoaiTV.SelectedValue;
            dto.SDT = txtSDT.Text;

            KhachHangBUS.DangKyThanhVien(dto);
        }
    }
}